<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : Categories.xsl
    Created on : February 19, 2012, 6:32 AM
    Author     : NP
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>

    <!-- TODO customize transformation rules 
         syntax recommendation http://www.w3.org/TR/xslt 
    -->
    <xsl:template match="/">
        <html>
            <xsl:apply-templates />
        </html>
    </xsl:template>

    <xsl:template match="category_list">
        <table id="categoryTable" >
            <tr>
                <th class="product" style="border-width: 2px; border-style: solid;">Category</th>
            </tr>
            <xsl:for-each select="category">
                <xsl:param name="id">
                    <xsl:value-of select="id"/>
                </xsl:param>
                <xsl:param name="name">
                    <xsl:value-of select="name"/>
                </xsl:param>
                <xsl:param name="image">
                    <xsl:value-of select="image"/>
                </xsl:param>
                <tr id="{$id}">
                    <td class="category">
                        <a href="/CSVNStore/index.jsp?txtName=&amp;category={$id}&amp;priceFrom=0&amp;priceTo=9999999">
                            <img class="category" src="{$image}" width="210" height="90" alt="{$name}" title="{$name}"/>
                        </a>
                    </td>
                </tr>
            </xsl:for-each>
        </table>
    </xsl:template>
</xsl:stylesheet>
